package model.effects;

import model.entity.Entity;
import model.stats.StatsTempMods;

public class StatMod extends Effect{
	private StatsTempMods mods; 
	private int baseValue;
	
	public StatMod(int baseValue, StatsTempMods mods){
		this.baseValue = baseValue;
		this.mods = mods;
	}
	
	@Override
	public void modifyParameter(double modification) {
		double temp = modification * baseValue;
		baseValue = (int) temp;
	}

	@Override
	public void doEffect(Entity e) {
		if(100*Math.random() <= baseValue)
			e.disable(baseValue);
		
	}
	
	@Override
	public String toString(double factor) {
		factor = Math.random() < .5 ? factor * -1 : factor;
		int newValue = (int)factor + this.baseValue;
		
		return " had it's stats modified for " + newValue + " value.";
	}
	
}
